package com.emasdemo.activity;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.alibaba.sdk.android.man.MANServiceProvider;
import com.emasdemo.R;

import java.util.HashMap;
import java.util.Map;

public class TestPageActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_test_page);

        initBar();

        Map<String, String> properties = new HashMap<>();
        properties.put("pageKey1", "pageValue1");
        properties.put("pageKey2", "pageValue2");
        MANServiceProvider.getService().getMANPageHitHelper().updatePageProperties(properties);
    }

    private void initBar() {
        findViewById(R.id.bar_img).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                TestPageActivity.this.finish();
            }
        });

        ((TextView)findViewById(R.id.bar_text)).setText("页面辅助埋点");
    }
}
